package spring;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.SQLOutput;


public class Mytest {
    @Test
    public void test(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");
        Car car  =(Car) applicationContext.getBean("car");
        Car car2  = applicationContext.getBean("myCar2",Car.class);
        Car car3  = applicationContext.getBean("myCar3",Car.class);
        System.out.println(car);
        System.out.println(car2);
        System.out.println(car3);
        Human zs = applicationContext.getBean("zs",Human.class);
        System.out.println(zs);
        Human lisi = applicationContext.getBean("lisi",Human.class);
        System.out.println(lisi);
    }

}
